#include <iostream>
#include <vector>
#include "Screen.h"
#include "windows.h"
#include <stdlib.h>
#include <conio.h>
using namespace std;

char Screen:: get(pos r,pos c) const
{
	pos row=r*width;
	return content[row+c];
}
inline Screen &Screen::move(pos r,pos c)
{
	pos row=r*(width+1);
	cursor=row+c;
	return *this;
}
inline Screen &Screen:: set(char c)
{
	content[cursor]=c;
	return *this;
}
inline Screen &Screen:: set(pos r,pos col,char ch)
{
	content[r*(width+1)+col]=ch;
	return *this;
}
/**
int main()
{
	vector<Screen> screens{Screen(7,5,'#'),Screen(7,5,'X'),Screen(7,5,'K'),Screen(7,5,'O'),Screen(7,5,'P'),Screen(7,5,'L'),Screen(7,5,'M')};
	HANDLE hout;
    COORD pos={0,0};
    CONSOLE_SCREEN_BUFFER_INFO csbi; //控制台屏幕缓冲区信息
	hout= GetStdHandle(STD_OUTPUT_HANDLE);
	GetConsoleScreenBufferInfo(hout,&csbi);
	pos.Y=csbi.dwCursorPosition.Y;
	for(int i=1;i<screens.size();++i)
	{	
		
		SetConsoleCursorPosition(hout,pos);
		screens[i].display(cout);
		Sleep(1000);
	}
	cout<<endl;
	return 0;
}**/